package com.bms.hystrix.interfaces.kzkyzl;

import com.bms.hystrix.vo.KongZhiKeYanZhiLiangGengXiShenHe;
import com.bms.hystrix.vo.KongZhiKeYanZhiLiangGengXiYuanGong;
import com.bms.hystrix.vo.KongZhiKeYanZhiLiangGengXinByIdVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

// 此接口与feign中定义的接口一样，直接迁移过来即可
// 调用一个子服务模块，需要在注解中指定，名字由client的yml文件定义
@FeignClient(value = "EUREKA-CLIENT-KZKYZL")
public interface ServiceFeignByCheck {
    /*
    这里需要几个要点：
    1.这里定义的路径作用是调用client中的接口
    2.这里的method即是只定义了get，在feign还是会检查client是否允许post请求，如果没有post请求将报错
    3.@RequestParam(value = "name")是绑定controller中的形式参数名，如果没有value属性定义也会报错
     */
//    @RequestMapping(value = "/login",method = RequestMethod.GET,
//            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
//    Map selectClient(@RequestParam(value = "username") String username);

    @RequestMapping(value = "/KeYanZhiLiangKongZhi/ChaXun",method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map<String, Object> ChaXun(@RequestParam(value = "xiangmuming") String xiangmuming,
                     @RequestParam(value = "faburen") String faburen,
                     @RequestParam(value = "zhixingzhuangtai") String zhixingzhuangtai);

    @RequestMapping(value = "/KeYanZhiLiangKongZhi/gengXinById",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map<String, Object> gengXinById(@RequestParam(value = "kongZhiKeYanZhiLiangGengXinByIdVo") KongZhiKeYanZhiLiangGengXinByIdVo kongZhiKeYanZhiLiangGengXinByIdVo);

    @RequestMapping(value = "/KeYanZhiLiangKongZhi/chaXunAll",method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map<String, Object> chaXunAll();

    @RequestMapping(value = "/KeYanZhiLiangKongZhi/gengXinYuanGong",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map<String, Object> gengXinYuanGong(@RequestParam(value = "KongZhiKeYanZhiLiangGengXiYuanGong") KongZhiKeYanZhiLiangGengXiYuanGong kongZhiKeYanZhiLiangGengXiYuanGong);


    @RequestMapping(value = "/KeYanZhiLiangKongZhi/gengXinShenHe",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map<String, Object> gengXinShenHe(@RequestParam(value = "KongZhiKeYanZhiLiangGengXiShenHe") KongZhiKeYanZhiLiangGengXiShenHe kongZhiKeYanZhiLiangGengXiShenHe);

}